#pragma once
#include "GPInclude.h"
#include "TFunction.h"

namespace TestMap
{
	void TestMultiMap();
}

namespace TestTemplateString
{
	template<typename T> std::string To_String(const T& rkValue)
	{
		std::ostringstream kOs;
		kOs<<rkValue;
		return kOs.str();
	}

	struct bad_from_string : std::bad_cast
	{
		const char* what() const
		{
			return "bad cast from string for From_String";
		}
	};

	template<typename T> T From_String(const std::string& rkString)
	{
		std::istringstream kIs(rkString);
		T kT;
		if(!(kIs>>kT))
		{
			throw bad_from_string();
		}
		return kT;
	}

	template<typename Target,typename Source>
	Target Lexical_Cast(Source kSource)
	{
		std::stringstream kStream;
		Target kTarget;
		if(!(kStream << kSource) 
		   || !(kStream >> kTarget)
		   || !(kStream >> std::ws).eof())
		{
			throw bad_from_string();
		}

		return kTarget;
	}
}

namespace TestRegex
{
	void TestSTLRegex(void);
}

namespace TestBitSet
{
	void TestBitSet(void);
}

namespace TestMemoryPack
{
//#pragma pack(4)
	struct ClassA
	{
		int c;
		char a;
		double d;
		char b;
	};

	void TestMemoryPack(void);
}

namespace TestSTLSize
{
	struct ClassA
	{
		int a;
		int b;
		double c;
		char d;
		std::string kString;
	};

	void TestSTLSize();
	void TestSTLLambda();
}

namespace TestTFunction
{
	bool Function_Test(const std::string& s);

	class FunctionMember
	{
	public:
		bool Function_Test(const std::string& s);
	};

	class FunctionObject
	{
	public:
		bool operator()(const std::string& s);
	};

	void Test();
}

namespace TestSinCosLook
{
	void Test(void);
}

namespace TestFastDistance
{
	void Test(void);
}

namespace TestInlineTemplate
{
	void TestCountOf(void);
}